<template>
  <div class="void">
    <div class="crop">
      <ul class="home_card-list" :style="{ '--count': 6 }">
        <li>
          <div class="home_card" @click="toOrder">
            <span
              >此处为任意门, 任意点击一个会随机跳转到一个订单
              ,每次都会不同哦，请打开你的今日盲盒叭~</span
            >
          </div>
        </li>
        <li>
          <div class="home_card">
            <a href="#">
              <img src="../assets/03.gif" alt="" />
            </a>
          </div>
        </li>
        <li>
          <div class="home_card" @click="toOrder">
            <span
              >此处为任意门, 任意点击一个会跳转到一个订单
              ,每天都会不同哦，请打开你的今日盲盒叭~</span
            >
          </div>
        </li>
        <li>
          <div class="home_card">
            <a href="#">
              <img src="../assets/03.gif" alt="" />
            </a>
          </div>
        </li>
        <li>
          <div class="home_card" @click="toOrder">
            <span
              >此处为任意门, 任意点击一个会跳转到一个订单
              ,每天都会不同哦，请打开你的今日盲盒叭~</span
            >
          </div>
        </li>
        <li>
          <div class="home_card">
            <a href="#">
              <img src="../assets/03.gif" alt="" />
            </a>
          </div>
        </li>
      </ul>
      <div class="last-circle"></div>
      <div class="second-circle"></div>
    </div>
    <div class="mask"></div>
    <div class="center-circle"></div>
  </div>
</template>
<script>
export default {
  name: "MyComponent",
  data() {
    return {
      max: 3,
      orderList: null,
      selectTypes: "所有",
      searchInput: "",
    };
  },
  mounted() {
    this.Requst();
  },
  methods: {
    toOrder() {
      this.$router.push({
        path: "/Details",
        query: {
          order_id: Math.floor(Math.random() * this.max),
        },
      });
    },
    Requst() {
      this.axios.post("http://127.0.0.1:8000/max/").then((res) => {
        this.max = res.data.data;
        console.log(this.max);
        console.log(Math.floor(Math.random() * this.max));
      });
    },
  },
};
</script>

<style scoped>
/* 设置容器样式 */
.void {
  width: 100%;
  /* max-width: 1024px; */
  margin: auto;
  position: relative;
  aspect-ratio: 1 / 1;
}

/* 鼠标悬停时暂停动画 */
ul:hover * {
  animation-play-state: paused;
}

/* 设置列表样式 */
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  z-index: 1;
}

/* 设置列表项样式 */
li {
  left: 0;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  animation: rotateCW calc(var(--rotate-speed) * 1s) var(--easing) infinite;
}

/* 设置卡片样式 */
.home_card {
  width: 30%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 24px;
  gap: 8px;
  background: #ffffff;
  box-shadow: 0px 4px 12px rgba(70, 0, 255, 0.1),
    0px 16px 32px rgba(165, 135, 255, 0.1);
  border-radius: 12px;
  font: 400 14px "";
  color: #535062;
  animation: rotateCCW calc(var(--rotate-speed) * 1s) var(--easing) infinite;
}

.home_card:hover {
  cursor: pointer;
}
/* 设置图片样式 */
.home_card img {
  width: 100%;
}

/* 设置链接样式 */
a {
  text-decoration: none;
  color: unset;
  display: block;
  height: 80px;
  overflow: hidden;
}

/* 设置模型名称样式 */
.model-name {
  font-weight: 500;
  font-size: 18px;
  line-height: 150%;
  color: #3b2ed0;
  display: block;
}

/* 设置SVG样式 */
svg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

/* 设置不同列表项的动画延迟 */
li:nth-child(2),
li:nth-child(2) .home_card {
  animation-delay: calc((var(--rotate-speed) / var(--count)) * -1s);
}

li:nth-child(3),
li:nth-child(3) .home_card {
  animation-delay: calc((var(--rotate-speed) / var(--count)) * -2s);
}

li:nth-child(4),
li:nth-child(4) .home_card {
  animation-delay: calc((var(--rotate-speed) / var(--count)) * -3s);
}

li:nth-child(5),
li:nth-child(5) .home_card {
  animation-delay: calc((var(--rotate-speed) / var(--count)) * -4s);
}

li:nth-child(6),
li:nth-child(6) .home_card {
  animation-delay: calc((var(--rotate-speed) / var(--count)) * -5s);
}

/* 定义顺时针旋转动画 */
@keyframes rotateCW {
  from {
    transform: translate3d(0px, -50%, -1px) rotate(45deg);
  }

  to {
    transform: translate3d(0px, -50%, 0px) rotate(315deg);
  }
}

/* 定义逆时针旋转动画 */
@keyframes rotateCCW {
  from {
    transform: rotate(-45deg);
  }

  to {
    transform: rotate(-315deg);
  }
}

/* 设置中心圆样式 */
.center-circle {
  position: fixed;
  width: 100px;
  z-index: 3;
  aspect-ratio: 1 / 1;
  left: 25%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  box-shadow: 0px 18px 36px -18px rgba(12, 5, 46, 0.3),
    0px 30px 60px -12px rgba(12, 5, 46, 0.25);
  border-radius: 50%;
  background-size: cover;
  background-position: -35px 0;
}

/* 设置第二个圆样式 */
.second-circle {
  position: fixed;
  width: 20%;
  aspect-ratio: 1 / 1;
  left: 25%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #f5f4fe;
  opacity: 0.5;
  box-shadow: 0px 18px 36px -18px rgba(12, 5, 46, 0.3),
    0px 30px 60px -12px rgba(12, 5, 46, 0.25);
  border-radius: 50%;
  background-image: url(../assets/03.gif);
}

/* 设置最后一个圆样式 */
.last-circle {
  position: fixed;
  width: 33%;
  aspect-ratio: 1 / 1;
  left: 25%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #f5f4fe;
  opacity: 0.25;
  box-shadow: 0px 18px 36px -18px rgba(12, 5, 46, 0.3),
    0px 30px 60px -12px rgba(12, 5, 46, 0.25);
  border-radius: 50%;
  background-image: url(../assets/03.gif);
}

/* 设置裁剪样式 */
/* .crop {
  mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 1)
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 1)
  );
} */

/* 设置遮罩样式 */
.mask {
  position: fixed;
  top: 10%;
  left: 0;
  bottom: 10%;
  width: 25%;
  background-position: 100% 50%;
  background-repeat: no-repeat;
  background-image: radial-gradient(
    100% 50% at 100% 50%,
    rgb(211, 194, 246) 0%,
    rgb(222, 210, 250) 10%,
    rgb(225, 214, 250) 20%,
    rgb(235, 229, 253) 30%,
    rgb(250, 249, 254) 45%,
    rgb(255, 255, 255) 50%
  );
  z-index: 2;
}

/* 设置遮罩样式后的效果 */
.mask:after {
  content: "";
  position: absolute;
  width: 1px;
  height: 100%;
  right: 0;
  display: block;
  background-image: linear-gradient(
    180deg,
    rgba(60, 26, 229, 0) 0%,
    #3c1ae5 50%,
    rgba(60, 26, 229, 0) 100%
  );
}
</style>
